var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2AudioManager = require("AudioManager");
var $2DataManager = require("DataManager");
var $2SceneStage = require("SceneStage");
var $2KDefine = require("KDefine");
var r = cc._decorator.ccclass;
var def_Car = /* */function (_cc$Component11) {
  babel_inherits(c, _cc$Component11);
  var _super13 = babel_createSuper(c);
  function c() {
    var _this38;
    babel_classCallCheck(this, c);
    _this38 = _super13.apply(this, arguments);
    _this38.isLaunch = false;
    return _this38;
  }
  babel_createClass(c, [{
    key: "onCollisionEnter",
    value: function onCollisionEnter(e, t) {
      var _this39 = this;
      if (!this.isLaunch) {
        this.isLaunch = true;
        $2SceneStage.default.instance && $2SceneStage.default.instance.ballPlantID && $2SceneStage.default.instance.ballPlantID.length >= 1 && $2SceneStage.default.instance.ballPlant < 2 && $2SceneStage.default.instance.canCreateBall && 0 != $2DataManager.default.instance.level && 2 != $2DataManager.default.instance.level && $2SceneStage.default.instance.createBall();
        this.node.getChildByName("Effect").active = true;
        this.node.getChildByName("Effect2").active = true;
        this.node.getChildByName("Effect").getComponent(sp.Skeleton).setAnimation(0, "newAnimation1", false);
        this.node.getChildByName("Effect2").getComponent(sp.Skeleton).setAnimation(0, "newAnimation1", false);
        this.node.getChildByName("Effect").getComponent(sp.Skeleton).setCompleteListener(function () {
          _this39.node.getChildByName("Effect").getComponent(sp.Skeleton).setCompleteListener(null);
          _this39.node.getChildByName("Effect").getComponent(sp.Skeleton).setAnimation(0, "newAnimation2", true);
          _this39.scheduleOnce(function () {
            _this39.node.getChildByName("Effect2").getComponent(sp.Skeleton).setAnimation(0, "newAnimation2", true);
          }, .05);
        });
        $2AudioManager.default.instance.playEffect($2KDefine.AudioName.CarEff);
        cc.tween(this.node).to(3, {
          x: 1070
        }).call(function () {
          _this39.node.destroy();
        }).start();
      }
    }
  }]);
  return c;
}(cc.Component);
def_Car = cc__decorate([r], def_Car);
exports.default = def_Car;